/**
 *                            License
 * THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS  
 * CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). 
 * THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW.  
 * ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR  
 * COPYRIGHT LAW IS PROHIBITED.
 * 
 * BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND  
 * AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE  
 * MAY BE CONSIDERED TO BE A CONTRACT,
 * THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED 
 * HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
 * 
 */
package com.lineage.configure;

import com.lineage.configure.Annotations.Configures;

/**
 * Class <code>Configure</code> 服务器设置.
 * 
 * @author jrwz
 * @version 2012-5-23下午04:38:51
 * @see com.lineage.config
 * @since JDK1.7
 */
public final class ConfigureServer {

    /** 配置文件路径. */
    private static final String SERVER = "./config/server.properties";

    /** 调试模式. */
    @Configures(file = SERVER, key = "DebugMode")
    public static boolean DEBUG_MODE = false;

    /** 服务器主机(IP). */
    @Configures(file = SERVER, key = "GameserverHostname")
    public static String GAME_SERVER_HOST_NAME = "*";

    /** 服务器端口. */
    @Configures(file = SERVER, key = "GameserverPort")
    public static int GAME_SERVER_PORT = 2000;

    /** 时区设置. */
    @Configures(file = SERVER, key = "TimeZone")
    public static String TIME_ZONE = "Etc/GMT+8";

    /** 客户端语系. */
    @Configures(file = SERVER, key = "ClientLanguage")
    public static int CLIENT_LANGUAGE = 5;

    /** 客户端编码. */
    public static String CLIENT_LANGUAGE_CODE;

    /** 编码的清单. */
    public static String[] LANGUAGE_CODE_ARRAY = { "UTF8", "EUCKR", "UTF8",
            "BIG5", "SJIS", "GBK" };

    /**
     * 加载客户端编码.
     */
    private static void clientLanguageCodeLoad() {
        CLIENT_LANGUAGE_CODE = LANGUAGE_CODE_ARRAY[CLIENT_LANGUAGE];
    }

    /**
     * 加载.
     */
    public static void load() {
        new ConfigureLoader().load(ConfigureServer.class);
        clientLanguageCodeLoad();
    }

    /** 服务器设置. */
    private ConfigureServer() {
    }

}
